﻿Imports LRS.BLL
Imports System.Windows.Forms
Public Class ConfigurationForm

    Private Sub ConfigurationForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        nudFineFactor.Value = Decimal.Parse(bConfiguration.GetPropertyValue("FineFactor")) * 100
        nudMaxDay.Value = Decimal.Parse(bConfiguration.GetPropertyValue("MaxDay"))
        nudMaxQuantity.Value = Decimal.Parse(bConfiguration.GetPropertyValue("MaxQuantity"))
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        bConfiguration.ChangePropertyValue("FineFactor", nudFineFactor.Value / 100)
        bConfiguration.ChangePropertyValue("MaxDay", nudMaxDay.Value)
        bConfiguration.ChangePropertyValue("MaxQuantity", nudMaxQuantity.Value)
        LRSInfo.FineFactor = nudFineFactor.Value / 100
        LRSInfo.MaxQuantity = nudMaxQuantity.Value
        LRSInfo.MaxDay = nudMaxDay.Value
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = DialogResult.Cancel
        Me.Close()
    End Sub
End Class